package com.alibaba.yinan.domain.task.resource;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author yinan
 */
@Getter
@RequiredArgsConstructor
public class ResourceRequirement {

    /**
     * key: 资源类型，例如 CASSETTE, SLOT, SAMPLE, REAGENT
     * value: 需要的数量
     */
    private final Map<String, Integer> requiredResources;

    /**
     * 获取某类资源需求数量
     */
    public int getQuantity(String resourceType) {
        return requiredResources.getOrDefault(resourceType, 0);
    }
}